#include <slm/vec4.h>

SLMATH_BEGIN()

void vec4::normalize()
{
	float len = length();
	SLMATH_VEC_ASSERT( len >= FLT_MIN );
	*this *= 1.f / len;
}

bool equal(const vec4& left, const vec4& right, float tolerance)
{
	return slm::equal(left.x, right.x, tolerance) &&
		slm::equal(left.y, right.y, tolerance) && 
		slm::equal(left.z, right.z, tolerance) && 
		slm::equal(left.w, right.w, tolerance);
}

SLMATH_END()

// This file is part of 'slm' C++ library. Copyright (C) 2009 Jani Kajala (kajala@gmail.com). See http://sourceforge.net/projects/slm/
